Skip to content

feat: add Buildkite OIDC credential detection - #415

Merged
cloudsmith-iduffy merged 4 commits into
masterfrom
cloudsmith-iduffy-buildkite-oidc-detector
Oct 5, 2026
Merged

cloudsmith-iduffy merged 4 commits into
masterfrom
cloudsmith-iduffy-buildkite-oidc-detector

Conversation

@cloudsmith-iduffy

@cloudsmith-iduffy cloudsmith-iduffy commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • detect Buildkite pipeline jobs via BUILDKITE and BUILDKITE_JOB_ID
  • request a job OIDC token with buildkite-agent oidc request-token
  • support the existing --oidc-audience / CLOUDSMITH_OIDC_AUDIENCE override, defaulting to cloudsmith
  • register and document the buildkite detector

Testing

  • uv run pytest -q cloudsmith_cli/core/tests/test_buildkite_detector.py cloudsmith_cli/core/tests/test_detector_controls.py
  • env -u CLOUDSMITH_WORKSPACE -u CLOUDSMITH_ORG uv run pytest -q -m 'not integration'
  • uv run pre-commit run --files cloudsmith_cli/core/credentials/oidc/detectors/buildkite.py cloudsmith_cli/core/credentials/oidc/detectors/__init__.py cloudsmith_cli/core/tests/test_buildkite_detector.py README.md

End-to-end validation

The detector was validated end to end with the reproducible cloudsmith-iduffy/cloudsmith-cli-oidc-test harness. Its Buildkite pipeline configuration downloads the Linux x86_64 GNU standalone binary built from this PR's commit ff2c7ceabcb6126643fc6c0e1b92b620eee0be1b, verifies its pinned SHA256, rejects CLOUDSMITH_API_KEY, and runs cloudsmith --debug whoami --verbose with an isolated home directory.

Detected OIDC environment: Buildkite
User: buildkite (slug: buildkite-4mav)
Authentication Method: SSO Token (primary)
PASS: Cloudsmith authenticated through Buildkite OIDC

No Cloudsmith API key was supplied or available to the job; authentication used the Buildkite-issued OIDC token with audience cloudsmith.

@cloudsmith-iduffy
cloudsmith-iduffy marked this pull request as ready for review September 24, 2026 14:14
@cloudsmith-iduffy
cloudsmith-iduffy requested a review from a team as a code owner September 24, 2026 14:14
Copilot AI lite review requested due to automatic review settings September 24, 2026 14:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Adds Buildkite OIDC credential detection and token retrieval to the CLI.

Changes:

  • Detects Buildkite jobs and requests OIDC tokens via buildkite-agent.
  • Supports configurable audiences, defaulting to cloudsmith.
  • Registers, documents, and tests the new detector.
File Description
README.md Documents Buildkite OIDC support and detector ID.
cloudsmith_cli/​core/​tests/​test_buildkite_detector.py Tests detection, token retrieval, audiences, and integration.
cloudsmith_cli/​core/​credentials/​oidc/​detectors/​buildkite.py Implements Buildkite OIDC detection and token retrieval.
cloudsmith_cli/​core/​credentials/​oidc/​detectors/​__init__.py Registers the Buildkite detector.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@tigh-latte tigh-latte left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one q

Comment thread cloudsmith_cli/core/credentials/oidc/detectors/buildkite.py Outdated
@cloudsmith-iduffy
cloudsmith-iduffy force-pushed the cloudsmith-iduffy-buildkite-oidc-detector branch from 7af3693 to 38426e6 Compare October 5, 2026 17:39
@cloudsmith-iduffy
cloudsmith-iduffy merged commit d6da221 into master Oct 5, 2026
19 checks passed
@cloudsmith-iduffy
cloudsmith-iduffy deleted the cloudsmith-iduffy-buildkite-oidc-detector branch October 5, 2026 17:40
tigh-latte added a commit that referenced this pull request Oct 7, 2026
tigh-latte added a commit that referenced this pull request Oct 7, 2026
tigh-latte added a commit that referenced this pull request Oct 7, 2026
tigh-latte added a commit that referenced this pull request Oct 8, 2026
* Reapply "feat: add Buildkite OIDC credential detection (#415)"

This reverts commit 3b5c328.

* Reapply "feat: add Google Cloud OIDC detector (#306)"

This reverts commit f194d83.

* Potential fix for pull request finding 'Add Buildkite OIDC detector to the changelog'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants